home *** CD-ROM | disk | FTP | other *** search
/ The Fatted Calf / The Fatted Calf.iso / Applications / Scheduling / Cassandra / Source / Clock.h < prev    next >
Encoding:
Text File  |  1990-12-02  |  2.5 KB  |  87 lines

  1.  
  2. //
  3. // Clock.h   -- Part of Cassandra
  4. // Original Author: Ali Ozer
  5. // Modifier: Jiro Nakamura
  6. // Modifications Copyright (c) 1990 by Jiro Nakamura
  7. // All rights reserved.
  8. //
  9.  
  10. #import <appkit/View.h>
  11. #import <appkit/NXImage.h>
  12. #import <dpsclient/event.h>      // For NXCoord, NXRect, etc
  13. #import <dpsclient/dpsclient.h>  // For DPSTimedEntry, used below
  14. #import <objc/typedstream.h>     // For read: and write: decls, below
  15. #import "Global.h"
  16.  
  17. @interface Clock:View
  18. {
  19.   DPSTimedEntry clockTE;     // The clock timed entry
  20.   NXImage *clockFace;              // The bitmap of the clock background
  21.   NXPoint compositeTo;       // The point to composite the bitmap to...
  22.   float minuteLen, hourLen;  // The length of the arms
  23.   float backgroundGray;         // To fill background
  24.   float clockGray;         // To draw the arms (minute, hour, second)
  25.   BOOL showSeconds;          // Show seconds hand?
  26.   BOOL showDate;        // Show date like fancy Rolexes?
  27.   BOOL militaryTime;
  28.   int    clockType;
  29.   char eventTime[80], eventMessage[80];
  30.   
  31.   
  32.   // Added by Jiro for target/action response. Jan 6, 1990
  33.   id target;        // the target
  34.   SEL action;        // and the action
  35. }
  36.  
  37. + newFrame:(const NXRect *)frm;
  38. - free;
  39.  
  40. // The following methods can be connected to user interface objects in
  41. // Interface Builder. 
  42.  
  43. - setShowSeconds:sender;    // Connect to a two-state button
  44. - setShowDate: sender;        //   ditto
  45. - setClockFace:sender;            // Connect to something with string value
  46. - setBackgroundGray:sender;    // Connect to a floating value source
  47. - setClockGray:sender;            // Same with this one
  48.  
  49. // Call the following methods to set/get values of various parameters
  50. // affecting the look of the clock.
  51.  
  52. - setClockFaceToBitmapNamed:(const char *)bitmapName;
  53. - setShowSecondsToBool:(BOOL)seconds;
  54. - setShowDateToBool:(BOOL)date;
  55. - setMilitaryTimeToBool:(BOOL)mt;
  56. - setBackgroundGrayToFloat:(float)gray;
  57. - setClockGrayToFloat:(float)gray;
  58. - setClockTypeToInt: (int) type;
  59. - setMessage: (char *) buf1 : (char *) buf2;
  60.  
  61. // Added by jiro to allow target/action response from Cassandra
  62. // Modified Jan 6, 1990
  63. - setTarget: (id) aTarget;
  64. - setAction: (SEL) anAction;
  65.  
  66. - (const char *)clockFaceBitmapName;
  67. - (BOOL)showSeconds;
  68. - (BOOL)showDate;
  69. - (float)backgroundGray;
  70. - (float)clockGray;
  71.  
  72. // The following methods are internal and are used to maintain the clock.
  73.  
  74. - drawSelf:(NXRect *)rects :(int)rectCount;
  75. - startTimedEntry:(BOOL)fireASAP;
  76. - stopTimedEntry;
  77. - computeNewSizes;
  78. - computeBitmapLocation;
  79. - sizeTo:(NXCoord)w :(NXCoord)h;
  80.  
  81. // Archiver methods.
  82.  
  83. - awake;
  84. - read:(NXTypedStream *)stream;
  85. - write:(NXTypedStream *)stream;
  86. @end
  87.